if(!aiviki.ax)
	{
	aiviki.ax = aiviki.Class.create("aiviki.ax");
	aiviki.ax.manage = function()
		{

		return {
			getXml:function(url,callback,cont)
			{
				this._caller(url,"GET",callback,cont,true,null);
			},
			get:function(url,callback,cont)
			{
				this._caller(url,"GET",callback,cont,false,null);
			},
			post:function(url,callback,cont,vars)
			{
				this._caller(url,"POST",callback,cont,false,vars);
			},
			_debug: false,
			_caller:function(url,method,callback,cont,isXml,vars)
			{
				var req =this._createXMLHttpRequest();
				var caller = {reqx: req,
										callback: callback,
										url: url,
										xml:isXml,
										content:cont};
				req.onreadystatechange = function()
					{
					aiviki.ax.manage._onResponseStateChange(caller);
					}
				req.open(method, url, true);

				if(method=="GET")
				{
					alert("big5");
				req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=big5');
				req.send(null);
				
				}else{

				req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=big5');
				var body=this._createHTTPVar(vars);
				req.send(body);
				}

			},
			_onResponseStateChange:function(caller)
			{


			var req = caller.reqx;
			if (req.readyState != 4) { 
				return;
				}

			if(req.readyState == 4)
				{ 

				this._debug("Call to " + caller.url + " has returned.");
				var callback = caller.callback;
				var data = caller.isXml?req.responseXML:req.responseText;
				var content=caller.content;
				caller = null;
				this._debug(data);
				if(callback!=null)
					callback(data,content);
				}



			},
			_createHTTPVar: function(vars) {
				if(vars==null)return null;
					var varsString = "";
					for( key in vars ) {
						varsString += '&' + vars[key][0] + '=' + vars[key][1];
					}
					if (varsString.length > 0) {
						varsString = varsString.substring(1); // chomp initial '&'
					}
					this._debug("Built var String: " + varsString)
					return varsString;
			 },
		  _createXMLHttpRequest: function()
			{
	    if(window.XMLHttpRequest)
				{
	      return new XMLHttpRequest();
			  }
				else if (window.ActiveXObject)
				{
	      return new ActiveXObject('Microsoft.XMLHTTP')
		    }
				else
				{
	      _error("Could not create XMLHttpRequest on this browser");
		    return null;
				}
		  },
			_debug: function(message) {
//					if (this._debug) {
//						alert("AX Message:\n\n" + message);
//					}
			},

			_error: function(message) {
				//	if (this._debug) {
					//	alert("AX ERROR:\n\n" + message);
				//	}
				}
		};
		}();


	}
